<%-- 
    Document   : rightSanpham
    Created on : 28-09-2011, 10:01:44
    Author     : Mr-Nguyen
--%>

<%@page import="DAO.sanphamDAO"%>
<%@page import="DatabasePOJO.sanpham"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
 ArrayList<sanpham> arr = sanphamDAO.getListSanPham("");
   for(int i =0; i<3;i++){
%>
<table width="100%"  border="0">
        <tr>
          <td height="54" style="background-color:pink">
              <a href="index.jsp?Action=chitiet&MaSanPham=<%= arr.get(i).getMaSanPham() %>"><%= arr.get(i).getTitle().substring(0, 50) %>...</a>
          </td>
        </tr>
        <tr>
          <td height="199">
              <img src="Images/<%= arr.get(i).getHinhDaiDien() %>" alt="" width="100%" height="205" />
          </td>
        </tr>
        <tr>
          <td height="53">
              <table width="100%" border="0" background="Images/backlogo.gif">
            <tr>
              <td width="50%" style="text-decoration: line-through;">
                  <%= arr.get(i).getGiaBan() %>VNĐ
              </td>
              <td width="50%" rowspan="2" align="center">
                  <%= arr.get(i).getGiaKhuyenMai() %>VNĐ
              </td>
            </tr>
            <tr>
              <td >
                  <%= Integer.parseInt(arr.get(i).getGiaBan()) - Integer.parseInt(arr.get(i).getGiaKhuyenMai())  %>VNĐ
              </td>
              </tr>
          </table>
          </td>
        </tr>
        <tr>
          <td height="40">
          <table width="100%" border="0">
            <tr>
                <td width="36%" align="right"  colspan="2" style="background-color:pink"><%= arr.get(i).getLuotMua() %> Lược mua</td>
            </tr>
          </table>
          </td>
        </tr>
    </table>
 <%}%>